/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.boxin.ims.modules.wechat.dao;

import java.util.List;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Component;

import com.thinkgem.jeesite.common.persistence.BaseDao;
import com.thinkgem.jeesite.common.persistence.BaseDaoImpl;
import com.boxin.ims.modules.wechat.entity.QuestionnaireReplyHuman;

/**
 * 调查问卷回答的用户DAO接口
 * @author XiaoQian
 * @version 2014-05-10
 */
public interface QuestionnaireReplyHumanDao extends QuestionnaireReplyHumanDaoCustom, CrudRepository<QuestionnaireReplyHuman, Long> {

	@Modifying
	@Query("delete from  QuestionnaireReplyHuman   where id = ?1")
	public int deleteById(Long id);
	
	@Query(" from  QuestionnaireReplyHuman   where wechatMember.id = ?1 and questionnaire.id=?2 and DATE_FORMAT(createTime,'%Y%m%d')=DATE_FORMAT(now(),'%Y%m%d')")
	public List<QuestionnaireReplyHuman> getByWechatId(Long memberId,Long questionnaireId);
	
}

/**
 * DAO自定义接口
 * @author XiaoQian
 */
interface QuestionnaireReplyHumanDaoCustom extends BaseDao<QuestionnaireReplyHuman> {

}

/**
 * DAO自定义接口实现
 * @author XiaoQian
 */
@Component
class QuestionnaireReplyHumanDaoImpl extends BaseDaoImpl<QuestionnaireReplyHuman> implements QuestionnaireReplyHumanDaoCustom {

}
